<?php namespace Home\Model;
use Think\Model;

/**
 * Class 验证控制器
 * @package Home\Controller
 */
class VerifyModel extends Model
{
    /**
     * 随机获取一条验证
     */
    public function getOneVerify(){

        $sql = "select * from verify order by rand() limit 1";

        $question = $this->query($sql);

        $question = current($question);

        $_SESSION['answer'] = $question['answer'];

        return $question;

    }

    
}
